<template>
	<view id="withdraw-record">
		<view class="record-list">
			<view class="record-cell" v-for="(item,index) in recordList" :key="index">
				<view class="record-li">
					<view class="title">{{item.log}}</view>
					<view class="money">提现金额：{{item.cash_money}}</view>
				</view>
				<view class="record-li">
					<view class="time">{{item.cash_time}}</view>
					<view class="status">状态:{{item.status_name}}</view>
				</view>
				<view class="bank-info-box" v-if="item.log.indexOf('银行卡提现') >=0 && item.status == 2">
					付款方账号：尾号{{item.bank_num}}
				</view>
			</view>
			<view class="no-data-tips" v-if="recordList.length == 0">
				<image class="no-data-img" src="../../static/img/no-data-img.png" mode=""></image>
				<view>暂无数据</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
	   apiPushUserWithdrawList
	} from '../../../http/apis.js'

	import {
		mapState
	} from 'vuex'
	export default {
		computed: {
			...mapState(['token'])
		},
		data() {
			return {
				recordList: {},
				recordForm: {
					token: '',
					page: 1,
					pageSize: 999
				},
				allNum: 0
			}
		},
		onShow() {
			this.recordForm.token = this.token
			apiPushUserWithdrawList(this.recordForm).then(res =>{
			    if(res.data.code == 1)  {
					this.recordList = res.data.msg.res
					this.allNum = res.data.msg.con
					for(var i in this.recordList){
						this.recordList[i].bank_num = this.recordList[i].bank_num.substring(this.recordList[i].bank_num.length-4,this.recordList[i].bank_num.length)
            this.recordList[i].cash_all_money = (parseFloat(this.recordList[i].cash_money) + parseFloat(this.recordList[i].com_money)).toFixed(2);
					}
				}
			}).catch(res => {
				this.$msg.showToast(res.data.msg)
			})
		},
		onLoad() {

		},
		methods:{

		}
	}
</script>

<style lang="scss">
	#withdraw-record{
		.record-list {
			.record-cell {
				padding: 32upx;
				border: 1px solid #E9E9E9;
				.record-li {
					display: flex;
					justify-content:space-between;
					font-family: PingFangSC-Regular, PingFang SC;
					&:nth-child(2){
						margin-top: 20upx;
					}
					.title {
						font-size: 32upx;
						font-weight: 400;
						color: #333333;
						line-height: 32upx;
					}
					.money {
						font-size: 32upx;
						font-weight: 500;
						color: #333333;
						line-height: 32upx;
					}
					.time {
						font-size: 28upx;
						font-weight: 400;
						color: #999999;
						line-height: 28upx;
					}
					.status{
						font-size: 28upx;
						font-weight: 400;
						color: #999999;
						line-height: 28upx;
					}

				}
				.bank-info-box {
					font-size: 28upx;
					font-weight: 400;
					color: #666666;
					line-height: 28upx;
					margin-top: 32upx;
				}
			}
		}
		.no-data-tips {
			text-align: center;
			font-size: 28upx;
			font-weight: 400;
			color: #999999;
			line-height: 28upx;
			.no-data-img {
				width: 300upx;
				height: 300upx;
				margin-top: 200upx;
				margin-bottom: 20upx;
			}
		}
	}
</style>
